package template_wrapper

import (
	html_template "html/template"
	"io"
	text_template "text/template"
)

type TemplateWrapper interface {
	RenderTemplate(writer io.Writer, data any) error
}

type TextTemplate struct {
	TargetTemplate *text_template.Template
}

func (_wrapper *TextTemplate) RenderTemplate(writer io.Writer, data any) error {
	return _wrapper.TargetTemplate.Execute(writer, data)
}

type HtmlTemplate struct {
	TargetTemplate *html_template.Template
}

func (_wrapper *HtmlTemplate) RenderTemplate(writer io.Writer, data any) error {
	return _wrapper.TargetTemplate.Execute(writer, data)
}
